package cn.edu.lit.jsjxy.CourseExample.chapter4;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import cn.edu.lit.jsjxy.CourseExample.R;

public class MainActivity_chap4 extends AppCompatActivity implements View.OnClickListener
{
    Button btnEx4_1, btnEx4_2, btnEx4_3, btnEx4_4, btnEx4_5, btnMusicPlaying,
            btnVideoPlaying;

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_chap4);
        btnEx4_2 = findViewById(R.id.btnEx4_2);
        btnEx4_1 = findViewById(R.id.btnEx4_1);

        btnEx4_3 = findViewById(R.id.btnEx4_3);
        btnEx4_4 = findViewById(R.id.btnEx4_4);
        btnEx4_5 = findViewById(R.id.btnEx4_5);
        btnMusicPlaying = findViewById(R.id.btnMusicPlaying);
        btnVideoPlaying = findViewById(R.id.btnVideoPlaying);


        btnEx4_1.setOnClickListener(this);
        btnEx4_2.setOnClickListener(this);
        btnEx4_3.setOnClickListener(this);
        btnEx4_4.setOnClickListener(this);
        btnEx4_5.setOnClickListener(this);
        btnMusicPlaying.setOnClickListener(this);
        btnVideoPlaying.setOnClickListener(this);


    }


    @Override
    public void onClick(View view)
    {
        Intent intent = new Intent();

        switch (view.getId())
        {
            case R.id.btnEx4_1:
                intent.setClass(this, DrawingActivity_4_1.class);
                startActivity(intent);
                break;
            case R.id.btnEx4_2:
                intent.setClass(this, DrawingActivity_4_2.class);
                startActivity(intent);
                break;
            case R.id.btnEx4_3:
                intent.setClass(this, DrawingActivity_4_3.class);
                startActivity(intent);
                break;
            case R.id.btnEx4_4:
                intent.setClass(this, DrawingActivity_4_4.class);
                startActivity(intent);
                break;
            case R.id.btnEx4_5:
                intent.setClass(this, SimpleFingerDrawActivity.class);
                startActivity(intent);
                break;

            case R.id.btnMusicPlaying:
                intent.setClass(this, MusicPlayingActivity.class);
                startActivity(intent);
                break;

            case R.id.btnVideoPlaying:
                intent.setClass(this, VideoPlayActivity.class);
                startActivity(intent);
                break;

        }


    }
}
